import store from "../../store"
import {getConfig} from '../ReturnAxios'
import {hideLoading, showLoading} from '../loading'

export default async () => {
  store.commit('SET_STORE_CONFIG_LOAD_STATUS', 'loading')
  showLoading()
  var res = await getConfig()
  hideLoading()
  res = res.data
  if (res.returnCode === 0) {
    store.commit('SET_STORE_CONFIG_LOAD_STATUS', '')
    return
  }
  store.dispatch('setStoreConfig', res.data[0])
}
